package bridge

import "fmt"

type Device interface {
	// 打开
	enable()
}

type Remote interface {
	// 打开
	On()
}

type Tv struct {
}

func (tv Tv) enable() {
	fmt.Println("电视打开了")
}

// 遥控器
type BigRemote struct {
	device Device
}

func (r BigRemote) On() {
	fmt.Println("bigRemote on")
	r.device.enable()
}

func NewBigRemote(device Device) Remote {
	return BigRemote{device: device}
}

type VolumeRemote struct {
	device Device
}

func (r VolumeRemote) On() {
	fmt.Println("声控开关")
	r.device.enable()
}

func NewVolumeRemote(device Device) Remote {
	return VolumeRemote{device: device}
}
